<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
    String path = request.getContextPath();
%>
<!doctype html>
<html>
<head>
	<meta charset="UTF-8">
    <meta name="copyright" content="Tencent"/>
    <meta name="keywords" content=""/>
    <meta name="description" content=""/>
    <meta name="author" content="social-touch.com"/>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="format-detection" content="telephone=no">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0,user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
	<title>药品评价</title>
	<link rel="stylesheet" type="text/css" href="<%=path%>/hplus/css/demo/public.css" />
	<link rel="stylesheet" type="text/css" href="<%=path%>/hplus/css/demo/base.css" />
	<link rel="stylesheet" type="text/css" href="<%=path%>/hplus/css/demo/style.css" />
	<style type="text/css">
	.box span{
	float: left;
    width: 20px;
    height: 20px;
    background: url(<%=path%>/hplus/img/star.png) no-repeat 0 -20px;
    background-size: 20px 40px;
    margin: 0 6px;
    cursor: pointer;
}
	</style>
</head>
<body>
		<div class="evaluate_con">
			<dl class="s_content fix" id="globalEva">
				<dt style="margin-top:25px;">整体评价</dt>
				<dd>
					<p class="smile"><img src="<%=path%>/hplus/img/smile.png" /><span >满意</span></p>
					<p class="cry"><img src="<%=path%>/hplus/img/cry.png" /><span >不满意</span></p>
				</dd>
			</dl>
			<dl class="s_content">
				<dt>药品疗效</dt>
				<dd>
					<div class="box J_xstar" id="service0">
						<span class=""></span>
						<span class=""></span>
						<span class=""></span>
						<span class=""></span>
						<span class=""></span>
						<i class="very_good">非常好</i>
						<i class="good">好</i>
						<i class="bad">差</i>
					</div>

				</dd>
			</dl>
			<dl class="s_content">
				<dt>药师服务</dt>
				<dd>
					<div class="box J_xstar" id="service1">
						<span class=""></span>
						<span class=""></span>
						<span class=""></span>
						<span class=""></span>
						<span class=""></span>
						<i class="very_good">非常好</i>
						<i class="good">好</i>
						<i class="bad">差</i>
					</div>
				</dd>
			</dl>
			<dl class="s_content">
				<dt>门店服务</dt>
				<dd>
					<div class="box J_xstar" id="service2">
						<span class=""></span>
						<span class=""></span>
						<span class=""></span>
						<span class=""></span>
						<span class=""></span>
						<i class="very_good">非常好</i>
						<i class="good">好</i>
						<i class="bad">差</i>
					</div>
				</dd>
			</dl>
		</div>

		<ul class="evaluate_con1 fix" id="tags">
		</ul>
		<textarea  id="description" readOnly="readOnly"></textarea>		
	</div>
	<script type="text/javascript" src="<%=path%>/hplus/js/jquery-1.8.1.min.js"></script>
	<script src="https://cdnjs.cloudflare.com/ajax/libs/datatables/1.10.16/js/jquery.dataTables.min.js"></script>
	<script src="<%=path%>/hplus/js/plugins/suggest/bootstrap-suggest.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
    <script src="<%=path%>/hplus/js/plugins/sweetalert/sweetalert2.min.js"></script>
	<script type="text/javascript" src="<%=path%>/bm/js/dialog.js"></script>
	<script type="text/javascript" src="<%=path%>/js/marketing/public.js"></script>
    <script>
	    var path = "<%=path%>";
	    var access_token=$.cookie('access_token');
	   	var cid=$.cookie('cid');
	   	var uid=$.cookie('uid');
	   	var evaluationId=getQueryString("evaluationId");
	   	var url=path+"/ser/evaluate/findByEvaluateId";
	   	$(function(){
	   		initData();
	   	});
	   	function initData(){
	   		$.post(
	   			url,{"id":evaluationId},function(data){
	   				fuc_setHtml(data);
	   			},"json"
	   		);
	   	}
	   	function fuc_setHtml(data){
	   		console.log(data);
	   		var globalEva=data.globalEva;
	   		if(globalEva!=null){
	   			if(globalEva=="5"){
	   				$('.smile').addClass('s_on');
	   				$('.smile').find('img').attr('src','<%=path%>/hplus/img/smile_on.png');
	   			}else{
	   				$('.cry').addClass('s_on');
	   				$('.cry').find('img').attr('src','<%=path%>/hplus/img/smile_on.png');
	   			}
	   		}
	   		var detail=data.detail;
	   		if(detail!=null){
	   			console.log(detail.length);
	   			for(var i=0;i<detail.length;i++){
	   				func_detail("#service"+i+" span",detail[i].score);
	   			}
	   		}
	   		var tags=data.tags;
	   		var option="";
	   		for(var i=0;i<tags.length;i++){
	   			option+="<li class='s_on'>"+tags[i]+"</li>";
	   		}
	   		$("#tags").html(option);
	   		console.log("------>description"+data.description);
	   		$("#description").val(data.description);
	   	}
	   	function func_detail(name,index){
	   		var $this=$(name);
			for(var i=0;i<index;i++){
				$this.eq(i).addClass('on');
			}	
		if(index == 5){
			$this.parent().find('.very_good').show();
			$this.parent().find('.good,.bad').hide();
		}else if(index == 4){
			$this.parent().find('.good').show();
			$this.parent().find('.very_good,.bad').hide();
		}else{
			$this.parent().find('.bad').show();
			$this.parent().find('.very_good,.good').hide();
		}
	   	}
	 </script>
</body>
</html>